package edu.cdnu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import edu.cdnu.common.result.ResultEntity;
import edu.cdnu.service.ResourceService;

@RestController
@RequestMapping("/resource")
public class ResourceController {

	@Autowired
	private ResourceService resourceService;
	
	/**
	 * 删除一个资源
	 * @param resourceId
	 */
	@DeleteMapping("/deleteResource/{resourceId}")
	public ResultEntity<?> deleteResource(@PathVariable Integer resourceId) {
		System.err.println(resourceId);
		resourceService.deleteResource(resourceId);
		return ResultEntity.createSuccessResult(null);
	}
	
	@GetMapping("/playChapter")
	public void playChpater(String path) throws Exception {
        
	}
}
